/*
编写 : Hexh
时间 : 2012-9-18 16:20:45
*/
using System.Collections.Generic;
using HMIS.FrameWork.DomainBase;
using HMIS.Infrastructure.Core.Entities;
using HMIS.Infrastructure.Core.Repositories;
using System;

namespace HMIS.Infrastructure.Facade.Impl
{
	/// <summary>
	///	 the impl of ICifCustFacade
	/// </summary>
	public class CifCustFacadeImpl : ICifCustFacade
	{

		private readonly ICifCustRepository CifCustRepository;

		public CifCustFacadeImpl(ICifCustRepository CifCustRepository)
		{
			this.CifCustRepository = CifCustRepository;
		}

		#region ICifCust Entity Save,Get,Update,Delete

		public CifCust Get(string id)
		{
			return CifCustRepository.Get(id);
		}

		public CifCust Load(string id)
		{
			return CifCustRepository.Load(id);
		}

		public void SaveOrUpdate(CifCust entity)
		{
			this.CifCustRepository.SaveOrUpdate(entity);
		}

		public void Delete(string id)
		{
			CifCustRepository.Delete(id);
		}
		
		public void PhysicsDelete(string id)
		{
			CifCustRepository.PhysicsDelete(id);
		}

		public bool IsFieldExist(string fieldName, string fieldValue, string id)
		{
			return CifCustRepository.IsFieldExist(fieldName, fieldValue, id);
		}
		
		public bool IsFieldExistWhere(string fieldName, string fieldValue, string id, string where)
		{
			return CifCustRepository.IsFieldExistWhere(fieldName, fieldValue, id, where);
		}
		
		#endregion
		
		#region Query 

		public IList<CifCust> GetAll()
		{
			return CifCustRepository.GetAll();
		}

		public IList<CifCust> GetPlist(string query, int start, int limit, string sort, string dir, List<DataFilter> filters, out long total)
		{
			return CifCustRepository.GetPlist(query, start, limit, sort, dir, filters, out total);
		}
		
		#endregion
	}
}
